#include "types.hpp"
#include "multiboot.hpp"
#include "system.hpp"
#include "vga.hpp"
#include "gdt.hpp"
#include "idt.hpp"
#include "pic.hpp"

extern "C" void kernel_main(multiboot_header *mbh, unsigned int magic_number);

extern "C" void bootloader_main(multiboot_header *mbh, unsigned int magic_number){

    if (magic_number != MULTIBOOT_BOOTLOADER_MAGIC){
        system::fatal_error("Invalid magic number"); //TODO: replace by an exception.
    }

    system::gdt_flush();
    system::idt_flush();
    system::init_pic();

    //TODO:...

    vga::cls();

    kernel_main(mbh, magic_number);

}



